<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Superpixel Benchmark: lib_eval/superpixel_tools.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Superpixel Benchmark
   </div>
   <div id="projectbrief">Superpixel benchmark, tools and algorithms.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_f07c7e2e21621c6454ef07b472f6f1ef.html">lib_eval</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">superpixel_tools.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="superpixel__tools_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#ifndef SUPERPIXEL_TOOLS_H</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#define SUPERPIXEL_TOOLS_H</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#include &lt;opencv2/opencv.hpp&gt;</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="classSuperpixelTools.html">   40</a></span>&#160;<span class="keyword">class </span><a class="code" href="classSuperpixelTools.html">SuperpixelTools</a> {</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classSuperpixelTools.html#a0816df16890a5ae85051c5aba777bf62">computeRegionSizeFromSuperpixels</a>(<span class="keyword">const</span> cv::Mat &amp;image, <span class="keywordtype">int</span> superpixels);</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    </div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classSuperpixelTools.html#a8790f88cee8b76b27b5ecfb6d26cd70f">computeHeightWidthFromSuperpixels</a>(<span class="keyword">const</span> cv::Mat &amp;image, </div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;            <span class="keywordtype">int</span> superpixels, <span class="keywordtype">int</span> &amp;height, <span class="keywordtype">int</span> &amp;width);</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    </div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classSuperpixelTools.html#a408d9d44b357e5dd01928f3250894013">computeHeightWidthLevelsFromSuperpixels</a>(<span class="keyword">const</span> cv::Mat &amp;image, </div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;            <span class="keywordtype">int</span> superpixels, <span class="keywordtype">int</span> &amp;height, <span class="keywordtype">int</span> &amp;width, <span class="keywordtype">int</span> &amp;levels);</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    </div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classSuperpixelTools.html#afaf7643c2a18389b6e237b56919abfc9">computeRegionSizeLevels</a>(<span class="keyword">const</span> cv::Mat &amp;image, </div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;            <span class="keywordtype">int</span> superpixels, <span class="keywordtype">int</span> &amp;region_size, <span class="keywordtype">int</span> &amp;levels);</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    </div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classSuperpixelTools.html#a2d29ccc05873472b9fa0936252d0f7c1">relabelSuperpixels</a>(cv::Mat &amp;labels);</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    </div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classSuperpixelTools.html#a561140deeedd92c1ca01d32aa8c7e4c4">computeLabelsFromBoundaries</a>(<span class="keyword">const</span> cv::Mat &amp;image, <span class="keyword">const</span> cv::Mat &amp;boundaries, </div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;            cv::Mat &amp;labels, <span class="keywordtype">int</span> BOUNDARY_VALUE = -1, <span class="keywordtype">int</span> INNER_VALUE = -2);</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    </div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classSuperpixelTools.html#af96e8a673fefbf8abdfcc7f34a7139a7">assignBoundariesToSuperpixels</a>(<span class="keyword">const</span> cv::Mat &amp;image, </div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;            <span class="keyword">const</span> cv::Mat &amp;boundaries, cv::Mat &amp;labels, <span class="keywordtype">int</span> BOUNDARY_VALUE = -1);</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    </div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classSuperpixelTools.html#a3fbd5f0a7107ef6edf7b984becbdd247">countSuperpixels</a>(<span class="keyword">const</span> cv::Mat &amp;labels);</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    </div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classSuperpixelTools.html#adc11994f0a1575477c7f4cb04ae90284">relabelConnectedSuperpixels</a>(cv::Mat &amp;labels);</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    </div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classSuperpixelTools.html#a17d54c4d603b7c33e49462110e98d07f">enforceMinimumSuperpixelSize</a>(<span class="keyword">const</span> cv::Mat &amp;image, cv::Mat &amp;labels, </div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;            <span class="keywordtype">int</span> size);</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    </div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classSuperpixelTools.html#a5aaf0277c4c0b811c97994ca777c8fb1">enforceMinimumSuperpixelSizeUpTo</a>(<span class="keyword">const</span> cv::Mat &amp;image, cv::Mat &amp;labels, </div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;            <span class="keywordtype">int</span> number);</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;};</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;<span class="preprocessor">#endif  </span><span class="comment">/* SUPERPIXEL_TOOLS_H */</span><span class="preprocessor"></span></div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;</div><div class="ttc" id="classSuperpixelTools_html_adc11994f0a1575477c7f4cb04ae90284"><div class="ttname"><a href="classSuperpixelTools.html#adc11994f0a1575477c7f4cb04ae90284">SuperpixelTools::relabelConnectedSuperpixels</a></div><div class="ttdeci">static int relabelConnectedSuperpixels(cv::Mat &amp;labels)</div><div class="ttdoc">Relabel superpixels based on connected components. </div><div class="ttdef"><b>Definition:</b> superpixel_tools.cpp:517</div></div>
<div class="ttc" id="classSuperpixelTools_html_a5aaf0277c4c0b811c97994ca777c8fb1"><div class="ttname"><a href="classSuperpixelTools.html#a5aaf0277c4c0b811c97994ca777c8fb1">SuperpixelTools::enforceMinimumSuperpixelSizeUpTo</a></div><div class="ttdeci">static int enforceMinimumSuperpixelSizeUpTo(const cv::Mat &amp;image, cv::Mat &amp;labels, int number)</div><div class="ttdoc">Enforce the minimum segment size by merging small superpixels with similar neighboring superpixels su...</div><div class="ttdef"><b>Definition:</b> superpixel_tools.cpp:661</div></div>
<div class="ttc" id="classSuperpixelTools_html_a3fbd5f0a7107ef6edf7b984becbdd247"><div class="ttname"><a href="classSuperpixelTools.html#a3fbd5f0a7107ef6edf7b984becbdd247">SuperpixelTools::countSuperpixels</a></div><div class="ttdeci">static int countSuperpixels(const cv::Mat &amp;labels)</div><div class="ttdoc">Count number of superpixels. </div><div class="ttdef"><b>Definition:</b> superpixel_tools.cpp:486</div></div>
<div class="ttc" id="classSuperpixelTools_html_afaf7643c2a18389b6e237b56919abfc9"><div class="ttname"><a href="classSuperpixelTools.html#afaf7643c2a18389b6e237b56919abfc9">SuperpixelTools::computeRegionSizeLevels</a></div><div class="ttdeci">static void computeRegionSizeLevels(const cv::Mat &amp;image, int superpixels, int &amp;region_size, int &amp;levels)</div><div class="ttdoc">Compute region size and levels for the given number of superpixels. </div><div class="ttdef"><b>Definition:</b> superpixel_tools.cpp:63</div></div>
<div class="ttc" id="classSuperpixelTools_html_a2d29ccc05873472b9fa0936252d0f7c1"><div class="ttname"><a href="classSuperpixelTools.html#a2d29ccc05873472b9fa0936252d0f7c1">SuperpixelTools::relabelSuperpixels</a></div><div class="ttdeci">static void relabelSuperpixels(cv::Mat &amp;labels)</div><div class="ttdoc">Relabel superpixel segmentation. </div><div class="ttdef"><b>Definition:</b> superpixel_tools.cpp:135</div></div>
<div class="ttc" id="classSuperpixelTools_html_a408d9d44b357e5dd01928f3250894013"><div class="ttname"><a href="classSuperpixelTools.html#a408d9d44b357e5dd01928f3250894013">SuperpixelTools::computeHeightWidthLevelsFromSuperpixels</a></div><div class="ttdeci">static void computeHeightWidthLevelsFromSuperpixels(const cv::Mat &amp;image, int superpixels, int &amp;height, int &amp;width, int &amp;levels)</div><div class="ttdoc">Compute width, height and levels for the given number of superpixels. </div><div class="ttdef"><b>Definition:</b> superpixel_tools.cpp:95</div></div>
<div class="ttc" id="classSuperpixelTools_html_af96e8a673fefbf8abdfcc7f34a7139a7"><div class="ttname"><a href="classSuperpixelTools.html#af96e8a673fefbf8abdfcc7f34a7139a7">SuperpixelTools::assignBoundariesToSuperpixels</a></div><div class="ttdeci">static void assignBoundariesToSuperpixels(const cv::Mat &amp;image, const cv::Mat &amp;boundaries, cv::Mat &amp;labels, int BOUNDARY_VALUE=-1)</div><div class="ttdoc">Assigns boundary pixels (indicated by -1) to the nearest superpixel (indicated by labels &gt;= 0)...</div><div class="ttdef"><b>Definition:</b> superpixel_tools.cpp:346</div></div>
<div class="ttc" id="classSuperpixelTools_html_a17d54c4d603b7c33e49462110e98d07f"><div class="ttname"><a href="classSuperpixelTools.html#a17d54c4d603b7c33e49462110e98d07f">SuperpixelTools::enforceMinimumSuperpixelSize</a></div><div class="ttdeci">static int enforceMinimumSuperpixelSize(const cv::Mat &amp;image, cv::Mat &amp;labels, int size)</div><div class="ttdoc">Enforce the minimum segment size by merging small superpixels with similar neighboring superpixels...</div><div class="ttdef"><b>Definition:</b> superpixel_tools.cpp:551</div></div>
<div class="ttc" id="classSuperpixelTools_html"><div class="ttname"><a href="classSuperpixelTools.html">SuperpixelTools</a></div><div class="ttdoc">Superpixel utilities. </div><div class="ttdef"><b>Definition:</b> superpixel_tools.h:40</div></div>
<div class="ttc" id="classSuperpixelTools_html_a8790f88cee8b76b27b5ecfb6d26cd70f"><div class="ttname"><a href="classSuperpixelTools.html#a8790f88cee8b76b27b5ecfb6d26cd70f">SuperpixelTools::computeHeightWidthFromSuperpixels</a></div><div class="ttdeci">static void computeHeightWidthFromSuperpixels(const cv::Mat &amp;image, int superpixels, int &amp;height, int &amp;width)</div><div class="ttdoc">Compute width and height for the given number of superpixels. </div><div class="ttdef"><b>Definition:</b> superpixel_tools.cpp:51</div></div>
<div class="ttc" id="classSuperpixelTools_html_a561140deeedd92c1ca01d32aa8c7e4c4"><div class="ttname"><a href="classSuperpixelTools.html#a561140deeedd92c1ca01d32aa8c7e4c4">SuperpixelTools::computeLabelsFromBoundaries</a></div><div class="ttdeci">static void computeLabelsFromBoundaries(const cv::Mat &amp;image, const cv::Mat &amp;boundaries, cv::Mat &amp;labels, int BOUNDARY_VALUE=-1, int INNER_VALUE=-2)</div><div class="ttdoc">Compute label map from boundaries by assigning boundary pixels to the nearest superpixel and flooding...</div><div class="ttdef"><b>Definition:</b> superpixel_tools.cpp:176</div></div>
<div class="ttc" id="classSuperpixelTools_html_a0816df16890a5ae85051c5aba777bf62"><div class="ttname"><a href="classSuperpixelTools.html#a0816df16890a5ae85051c5aba777bf62">SuperpixelTools::computeRegionSizeFromSuperpixels</a></div><div class="ttdeci">static int computeRegionSizeFromSuperpixels(const cv::Mat &amp;image, int superpixels)</div><div class="ttdoc">Compute region size from desired number of superpixels. </div><div class="ttdef"><b>Definition:</b> superpixel_tools.cpp:40</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sun Apr 16 2017 16:39:17 for Superpixel Benchmark by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
